package com.jwater.core.net;

import java.io.Serializable;

import com.jwater.core.common.S;
/**
 * @description:
 * @author: jnner
 * @createDate: 2021/2/5
 * @version: 1.0
 */
public class NodePacket implements Serializable {
	private static final long serialVersionUID = 2644066731915508555L;

	public static final Integer DATATYPE_HEART = 0x000;// 心跳包
	public static final Integer DATATYPE_HEART_RESPONSE = 0x001;// 心跳响应包
	public static final Integer DATATYPE_DATA = 0x002;// 数据包
	public static final Integer DATATYPE_SYNCCALL = 0x003;// 同步调用包
	public static final Integer DATATYPE_SYNCRESULT = 0x004;// 同步结果返回包
	public static final Integer DATATYPE_ASYNCCALL = 0x005;// 异步调用包
	public static final Integer DATATYPE_ASYNCRESULT = 0x006;// 异步结果返回包
	public static final Integer DATATYPE_INVOKE = 0x007;// rpc执行方法请求包
	public static final Integer DATATYPE_RETURN = 0x008;// rpc执行方法结果返回包
	public static final Integer DATATYPE_FILE = 0x009;// 文件包
	public static final Integer DATATYPE_FILE_RESULT = 0x0A;// 文件包

	private short version = S.NET_VERSION;
	private int dataType;
	private int number;
	private int length;
	private byte[] data;

	public short getVersion() {
		return version;
	}

	public void setVersion(short version) {
		this.version = version;
	}

	public int getDataType() {
		return dataType;
	}

	public void setDataType(int dataType) {
		this.dataType = dataType;
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

	public byte[] getData() {
		return data;
	}

	public void setData(byte[] data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return "NodePacket [version=" + version + ", dataType=" + dataType + ", number=" + number + ", length=" + length
				+ "]";
	}
}
